package exceptiondates;

import java.util.ArrayList;
import java.util.Date;

/***
 * Process the exception dates adding and return the array list of the decorated exception dates.
 */
public abstract class ExceptionDatesDecorator extends ExceptionDates {
	
	protected ExceptionDates decorated;
	
	/***
	 * Class constructor.
	 */
	public ExceptionDatesDecorator(){
		this.decorated = new NormalExceptionDates();
	}
	
	/***
	 * Class constructor specifying the decorated exception dates.
	 * @param decorated	the decorated exception dates
	 */
	public ExceptionDatesDecorator (ExceptionDates decorated){
		this.decorated = decorated;
	}
	
	/***
	 * Return the array list of the decorated exception dates.
	 * @return	the array list of the decorated exception dates
	 */
	@Override
	public final ArrayList<Date> getList() {
		ArrayList<Date> list = decorated.getList();
		for(Date d : dates){
			list.add(d);
		}
		return list;
	}

}
